<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html >
<head >
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link href="/css/admin.css" rel="stylesheet" type="text/css" />
	<script src="/js/jquery-1.5.1.min.js" type="text/javascript"></script>
	<script src="/js/jquery-ui-1.8.14/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>
	<link href="/js/dynatree-1.1.1/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css" />
	<script src="/js/dynatree-1.1.1/jquery.dynatree.js" type="text/javascript"></script>
	<style type="text/css">
		#navlogo{ background:#D4E4FF; color:#808080; font-size:20px; padding:15px 0px 0px 20px; }
		#navlogo a,#navlogo a:visited {color:#f2f2f2; text-decoration:none; }
		#navlogo a:hover {color:#FFFF2B; text-decoration:none;}
		#usrinfo{background:#D4E4FF;color:#999999; padding:5px 0px 20px 20px;}
	</style>
	<script type="text/javascript">
		$(document).ready(function () {
			$("#tree").dynatree({
				imagePath: "/images/", 				
				initAjax: {
					url: "/cms/doLoadColumn"//,
					//data: { id: "" }
				},
				/*onActivate: function (node) {
					if (node.data.url)
					{ window.parent.SetSrc(node.data.url); }
				},*/
				onClick: function (node) {
					$("#destid").val(node.data.key);
				},
				onLazyRead: function (node) {
					node.appendAjax({ url: "/cms/doLoadColumn/" + node.data.key //,
						//data: { "id": node.data.key }
					});
				}
			});

			$("#treeSource").dynatree({
				imagePath: "/images/", 				
				initAjax: {
					url: "/cms/doLoadColumn_OldSys"//,
					//data: { id: "" }
				},
				onClick: function (node) {
					$("#sourceid").val(node.data.key);
				},
				onLazyRead: function (node) {
					node.appendAjax({ url: "/cms/doLoadColumn_OldSys/" + node.data.key 
					});
				}
			});
		});

		function dosync(){
			$("#tip").html('processing...');
			$.post("/cms/dosync", { 			
				sourceid: $("#sourceid").val(), 
				destid: $("#destid").val()
			},function (data) {
					$("#tip").html(data);
			});
		}

	</script>
</head>
<body>
	<table cellpadding="5" border="1"><tr><td>Source</td><td>Dest</td></tr>
	<tr><td><div id="treeSource">
        </div></td><td><div id="tree">
        </div></td></tr>
        <tr><td><input type="text" id="sourceid" value="" /></td><td><input type="text" id="destid" value="" /></td></tr>
	</table>
	<br/>
	<input type="button" value="Do Sync" onclick="dosync()"/>
	<div id="tip" style="padding:5px;color:#ff0000;"></div>
    
</body>
</html>